console.log($event);

const { panel_config  = {} } = this.widgetObj._option;
const queryManage = this.pageObj.getApiWidgetByAliasName('queryManage')?.widgetObj;
const type = this.pageObj.getVariables().find(v => v.name === 'panelType')?.value || 0;
const process = this.pageObj.getVariables().find(v => v.name === 'whetherProcess')?.value || 0;
const _form = this.getApiPage().retrievePlugin('base-forms');
const searchText = _form.getFormData('form_12')?.search;



if($event.show && !$event?.id?.startsWith('all')) {
    const params = {
        pageNum: 1,
        pageSize: 10,
        projectCode: JSON.stringify([$event.projectCode]),
        // projectCodeList: JSON.stringify([$event.projectCode]),
        eventTitle: searchText,
        drillName: searchText,
        disableFlag: process
    };
    const uniqueKey = $event.uniqueKey;
    const title = $event.title;
    if (+type === 1) {
        if (title) params.drillLocation = title
    } else if (+type === 2) {
        if (title) params.eventType = title
    } else if (+type === 3) {
        if (title) params.eventGrade = title
    } else {
        if (title) params.drillLocation = title
    }

    window.__reloadDrillList = () => {
        queryManage.queryDrillList(params).then(({ success, result, count }) => {
            if(success) {
                const { page = {} } = panel_config;
                const option = {
                    dataSource: result,
                    total: count,
                    page: { ...page, current: 1 }
                };

                console.log(uniqueKey, option);
                this.widgetObj.tree.pannelRerender(uniqueKey, option)
            }
        })
    }

    __drill__list.activeParent = { ...$event };
    window.__reloadDrillList()
}
